import { resetLine } from './measureHeight'
import { clearPolygon, removeInputAction } from './measureArea'
import { clearPolygonRange, removeInputActionRange } from './measureRange'

/**
 * 所有清除类需要操作的内容
 */
export const handler = {
  measureArea: undefined,
  measureHeight: undefined,
  measureDistance: undefined,
  measureRange: undefined
}

export default () => {
  const { measureArea, measureHeight, measureDistance, measureRange } = handler
  measureRange && measureRange.deactivate()
  measureRange && measureRange.clear()
  clearPolygonRange()
  removeInputActionRange()

  measureArea && measureArea.deactivate()
  measureArea && measureArea.clear()
  clearPolygon()
  removeInputAction()

  measureHeight && measureHeight.deactivate()
  measureHeight && measureHeight.clear()
  resetLine()

  measureDistance && measureDistance.deactivate()
  measureDistance && measureDistance.clear()
  clearFanGuang()
}

// 清除泛光
export function clearFanGuang() {
  if (window.floodLightClear) {
    window.floodLightClear()
  }
}
export const clear = () => { }
